﻿package com.cilico.components;

import java.util.Vector;

/**
 * channel属性
 * @author lv.xiangan
 *
 */
public class ChannelParam {
	public final String name_;
	public final String label_;
	public final String placeholder_; // 输入框的提示文字
	public final String selectSort_;  // 单选按钮的联动对象和联动方式
	public final String sortKey_;
	public String value_; // 服务器传递的默认值，我们还用它来保存用户输入值
	public String type_;  // 可能值：radio or text or checkbox or select or label
	public String fillType_;// require or optional
	public Vector<String> valuesV_ = null;// 保存Select控件的label和value
	public boolean isChecked_;// use by radio and checkbox

	public ChannelParam(String n, String l, String v, String p, String type, String fillType, String ss, String sk) {
		name_ = n;
		label_ = l;
		value_ = v;
		placeholder_ = p;
		selectSort_ = ss;
		sortKey_ = sk;
		type_ = type;
		fillType_ = fillType;
		isChecked_ = false;
	}

	void setSelectValues(String label, String value) {
		if (valuesV_ == null)
			valuesV_ = new Vector<String>();
		valuesV_.addElement(label);
		valuesV_.addElement(value);
	}
}
